# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Language.V2.Model.XPSTablesConfidenceMetricsEntry do
  @moduledoc """
  Metrics for a single confidence threshold.

  ## Attributes

  *   `confidenceThreshold` (*type:* `float()`, *default:* `nil`) - The confidence threshold value used to compute the metrics.
  *   `f1Score` (*type:* `float()`, *default:* `nil`) - The harmonic mean of recall and precision. (2 * precision * recall) / (precision + recall)
  *   `falseNegativeCount` (*type:* `String.t`, *default:* `nil`) - False negative count.
  *   `falsePositiveCount` (*type:* `String.t`, *default:* `nil`) - False positive count.
  *   `falsePositiveRate` (*type:* `float()`, *default:* `nil`) - FPR = #false positives / (#false positives + #true negatives)
  *   `precision` (*type:* `float()`, *default:* `nil`) - Precision = #true positives / (#true positives + #false positives).
  *   `recall` (*type:* `float()`, *default:* `nil`) - Recall = #true positives / (#true positives + #false negatives).
  *   `trueNegativeCount` (*type:* `String.t`, *default:* `nil`) - True negative count.
  *   `truePositiveCount` (*type:* `String.t`, *default:* `nil`) - True positive count.
  *   `truePositiveRate` (*type:* `float()`, *default:* `nil`) - TPR = #true positives / (#true positives + #false negatvies)
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :confidenceThreshold => float() | nil,
          :f1Score => float() | nil,
          :falseNegativeCount => String.t() | nil,
          :falsePositiveCount => String.t() | nil,
          :falsePositiveRate => float() | nil,
          :precision => float() | nil,
          :recall => float() | nil,
          :trueNegativeCount => String.t() | nil,
          :truePositiveCount => String.t() | nil,
          :truePositiveRate => float() | nil
        }

  field(:confidenceThreshold)
  field(:f1Score)
  field(:falseNegativeCount)
  field(:falsePositiveCount)
  field(:falsePositiveRate)
  field(:precision)
  field(:recall)
  field(:trueNegativeCount)
  field(:truePositiveCount)
  field(:truePositiveRate)
end

defimpl Poison.Decoder, for: GoogleApi.Language.V2.Model.XPSTablesConfidenceMetricsEntry do
  def decode(value, options) do
    GoogleApi.Language.V2.Model.XPSTablesConfidenceMetricsEntry.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Language.V2.Model.XPSTablesConfidenceMetricsEntry do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
